//
//  BKTextField.m
//  baokaodaxue
//
//  Created by dangyangyang on 15/5/27.
//  Copyright (c) 2015年 报考大学. All rights reserved.
//

#import "BKTextField.h"

@implementation BKTextField
- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder{
    
    self = [super awakeAfterUsingCoder:aDecoder];
    if (self) {
        self.layer.borderColor = [[UIColor whiteColor] CGColor];
        self.layer.borderWidth = 1.5;
        self.textColor = [UIColor whiteColor];
        
        UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
        textLabel.text = self.placeholder;
        textLabel.font = [UIFont systemFontOfSize:14];
        textLabel.textColor = [UIColor whiteColor];
//        self.leftView = textLabel;
//        self.leftViewMode = UITextFieldViewModeAlways;
        self.textAlignment = NSTextAlignmentLeft;
       
    }

    return self;
}
- (void)awakeFromNib{

    UIColor *color = [UIColor whiteColor];
    
    self.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.placeholder attributes:@{NSForegroundColorAttributeName:color}];
}

- (CGRect)placeholderRectForBounds:(CGRect)bounds{

     return CGRectMake(15, 0, bounds.size.width, bounds.size.height);
}
- (CGRect)leftViewRectForBounds:(CGRect)bounds{
   
     return CGRectMake(15,  0, bounds.size.width, bounds.size.height);
}


- (CGRect)textRectForBounds:(CGRect)bounds{
    
    return CGRectMake(15, 0, bounds.size.width, bounds.size.height);
    
}

- (CGRect)editingRectForBounds:(CGRect)bounds{
    
    return CGRectMake(15, 0, bounds.size.width, bounds.size.height);
}

@end
